// 如果获取的数组中有新添加的数组，那就去掉
let arr = [{ id: 5 }, { id: 6 }]    // 新添加的数组
let arr1 = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 5 }, { id: 6 }]  // 获取的数组
let newArr = arr1.concat(arr)
let newArr2 = newArr.reduce((pre, cur) => {
    let index = pre.findIndex(item => item.id == cur.id)
    if (index == -1) {
        pre.push(cur)
    }
    return pre;
}, [])
console.log("newArr2", newArr2)